package Text1;

/*
 *@Student 张策
 */
public class Main {
    public static void main(String[] args) {
        String str="a";
        StringBuffer stringBuffer=new StringBuffer();
        long start1=System.currentTimeMillis();
        for (int i = 0; i < 90000; i++) {
            stringBuffer.append(String.valueOf(i));
        }
        long end1=System.currentTimeMillis();
        System.out.println(end1-start1);
        StringBuilder stringBuilder=new StringBuilder();
        long start2=System.currentTimeMillis();
        for (int i = 0; i < 90000; i++) {
            stringBuilder.append(System.currentTimeMillis());
        }
        long end2=System.currentTimeMillis();
        System.out.println(end2-start2);
        long start3=System.currentTimeMillis();
        for (int i = 0; i < 90000; i++) {
            str=str+i;
        }
        long end3=System.currentTimeMillis();
        System.out.println(end3-start3);


//        String str="012345996.3";
//        StringBuffer stringBuffer = new StringBuffer(str);
////        int num = stringBuffer.lastIndexOf(".");
////        int index = stringBuffer.lastIndexOf(".");
////        num/=3;
////        for (int i = 0; i <num; i++) {
////            stringBuffer.insert(index-3,",");
////            index-=3;
////        }
////        System.out.println(stringBuffer);
//        for (int i =stringBuffer.lastIndexOf(".")-3 ; i >0; i-=3) {
//            stringBuffer.insert(i,",");
//        }
//        System.out.println(stringBuffer);
    }
}
